package com.wtc.ployparameter;

public class PloyParameter {
    public static void main(String[] args) {
        Employee employee = new Worker("马可", 2500);
        showEmpAnnual(employee);
        testWork(employee);
        employee = new Manger("经理", 3500, 1000);
        showEmpAnnual(employee);
        testWork(employee);
    }
    public static void showEmpAnnual(Employee e) {
        System.out.println("当前工资为：" + e.getAnnual());
    }
    public static void testWork(Employee e) {
        if (e instanceof  Worker) {
            System.out.println(((Worker) e).work());
        } else if (e instanceof  Manger) {
            System.out.println(((Manger) e).manage());
        }
        "hahah".equals("hahahaah");
    }
}
